//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Project:			None
//
// Module Name:		CImageControl.h
//
// Environment:		Windows XX, Visual C++
//
// Description:		Create control to view any type of Images 		
//
// Title End
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//	History:
//		2013.05.25	Tran Dang Bao		v01		Create New
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef _CPictureCommon_H_
#define _CPictureCommon_H_

#include "stdafx.h"
//#include "afxwin.h"

class CPictureCommon : public CStatic
{
private:
	int m_nImageHeight;		// Image Height
	int m_nImageWidth;		// Image Width
	int m_nID;				// ID of control
	CString m_strImageName; // Name of Image
	//GDI Plus Token
	ULONG_PTR m_gdiplusToken;
	//Control flag if a pic is loaded
	BOOL m_bIsPicLoaded;
	//Internal image stream buffer
	IStream* m_pStream;
public:
	CWnd *m_CWndParent;		// handle of Parent Window
public:
	CPictureCommon(void);
	~CPictureCommon(void);

	void SetImageHeight( int ImageHeight );
	void SetImageWidth( int ImageWidth );
	int  GetImageHeight();
	int  GetImageWidth();

	BOOL CreateImageFromFile(CString &szFilePath);
public:  // public string folder
	//Draws the Control
	virtual void PreSubclassWindow();
	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
	virtual BOOL OnEraseBkgnd(CDC* pDC);

	DECLARE_MESSAGE_MAP()
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);

	//	void LoadViewImage( CString pathFolderImage );
   // CString m_strPathFolderImage;
};

#endif

